package bishiqiangxun;
import java.util.*;
public class Test {
    public static void main(String[] args) {
        //题目:组队竞赛
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        //输入
        int n = in.nextInt();
        int[] arr = new int[3*n];
        for(int i = 0; i < 3*n; i++) {
            arr[i] = in.nextInt();
        }
        Arrays.sort(arr);
        long sum = 0;
        for(int i = 0; i < n ; i++) {
            sum += arr[arr.length-2*(i+1)];
        }
        System.out.println(sum);
    }
}
